package FSMDE.controllers.tests.mocks;

import java.util.ArrayList;
import java.util.List;

import main.java.ERMDE.models.Diagram;
import main.java.FSMDE.controllers.IInterfaceController;
import main.java.FSMDE.controllers.listeners.IInterfaceEventListener;
import main.java.FSMDE.models.Interface;
import main.java.FSMDE.views.IInterfaceView;


public class MockInterfaceController implements IInterfaceController {

	private int createCalls;
	private List<IInterfaceEventListener> listeners;
	private int updateCalls;

	public MockInterfaceController(){
		this.createCalls = 0;
		this.updateCalls = 0;
		this.listeners = new ArrayList<IInterfaceEventListener>();
	}
	
	@Override
	public void addSubscriber(IInterfaceEventListener listener) {
		listeners.add( listener );
	}

	@Override
	public boolean addInterface() {
		return false;
	}

	@Override
	public void setInterfaceView(IInterfaceView interfaceView) {

	}

	@Override
	public void create() {
		this.createCalls++;
	}

    public int getCreateCallsCount() {
		return createCalls;
	}

	@Override
	public void create(Interface interFace) {
		this.updateCalls++;
	}

	@Override
	public boolean validInterfaceName(String interfaceName) {
		return false;
	}

	public int getUpdateCallsCount() {
		return this.updateCalls;
	}

	public List<IInterfaceEventListener> getListeners() {
		return listeners;
	}

	@Override
	public void setErmDiagrams(ArrayList<Diagram> ermDiagrams) {
	}

	@Override
	public void cancelPendingInterfaceAction() {
	}

}
